<%@ page contentType="text/html;charset=UTF-8"%>
<html>
<head>
<title>接口注册</title>
    <%@ include file="/common/meta.jsp" %>
	<%@ include file="/common/import.jsp" %>
	
	<script type="text/javascript">

	
	var to_eidt_url = '${ctx}/audit/auditRule/toEdit.action';
	
	$(function(){
		$.ajax({
			url: to_eidt_url,
  			method: "GET",
  			data: { ruleId : '${param.ruleId}' },
  			dataType: "json",
  			success:function(data){
  				var auditRule = data.auditRule;
  				$("#ruleId").val(auditRule.ruleId);
  				$("#tableName").val(auditRule.tableName);
  				$("input:radio[name='ifStart'][value='"+auditRule.ifStart+"']").attr("checked", 'true');
  				$("#checkUser").val(auditRule.checkUser);
  				$("#next").val(auditRule.next);
  				$("#last").val(auditRule.last);
  				$("#num").val(auditRule.num);
  				$("#auditType").val(auditRule.auditType);
  				
  			}
		});
		
	});
	
	var edit_url = '${ctx}/audit/auditRule/edit.action';
	function save(){
		$('#editAuditRuleForm').form('submit', {
			type:'post',
		    url:edit_url,
		    success:function(data){
		    	var oTxt = jQuery.parseJSON(data);
				var mess = oTxt.msg;
				var flag = oTxt.flag;
				if(flag=="T"){
					alert("操作成功");
					window.parent.closeWin();
					window.parent.reload();
		        	
				}else{
					alert("操作失败");
				}
				
		    },
		    error:function(){
				 alert("请检查服务器！");
			}
		});
     }

	
	function cancel(){
		window.parent.closeWin();
	}
	
	</script>
</head>
<body>	

		<form id="editAuditRuleForm" name="editAuditRuleForm" method="post" >
			<%--<input type="hidden" name="formToken" id="formToken" value="${formToken}"/>
			--%><table class="datagrid-body">
			<tr>
				<td class="datagrid-header">规则ID<font color=red>*</font></td>
				<td>
					<input id="ruleId" name="ruleId" value="${auditRule.ruleId}" style="background-color: #dddddd" type="text" readonly="readonly" />
				</td>
			</tr>
			<tr>
				<td class="datagrid-header">表名</td>
				<td>
					<input id="tableName"  name="tableName" value="${auditRule.tableName }" type="text" />
				</td>
			</tr>
			<tr>
				<td class="datagrid-header">是否起点<font color=red>*</font></td>
				<td>
					<label><input type="radio" name="ifStart" value="T" >是</label>
					 
  					<label><input type="radio" name="ifStart" value="F">否</label>
				</td>
			</tr>
			<tr>
				<td class="datagrid-header">审核人</td>
				<td>
					<input type="text" id="checkUser"  name="checkUser" value="${auditRule.checkUser }" >
				</td>
			</tr>
			<tr>
				<td class="datagrid-header">通过</td>
				<td>
					<input type="text" id="next" name="next" value="${auditRule.next }" >
				</td>
			</tr>
			<tr>
				<td class="datagrid-header">不通过</td>
				<td>
					<input type="text" id="last" name="last" value="${auditRule.last }" >
				</td>
			</tr>
			<tr>
				<td class="datagrid-header">次数</td>
				<td>
					<input type="text" id="num" name="num" value="${auditRule.num }" >
				</td>
			</tr>
			<tr>
				<td class="datagrid-header">审核类型</td>
				<td>
					<input type="text" id="auditType" name="auditType" value="${auditRule.auditType }" >
				</td>
			</tr>
			
			<tr>
				<td colspan="2" align="center">	
				<a class="easyui-linkbutton" id="bt1" iconCls="icon-ok" onclick="save();">提交</a>  
	    		<a class="easyui-linkbutton" id="bt2" iconCls="icon-cancel" onclick="cancel();">取消</a>
				</td>
			</tr>
			</table>
		</form>
</body>
</html>
